package p270jp.pxv.android.legacy.model;

import java.util.List;

/* renamed from: jp.pxv.android.legacy.model.PixivIllust */
/* loaded from: classes2.dex */
public class PixivIllust extends PixivWork {
    public int height;
    public List<PixivMetaPage> metaPages;
    public PixivMetaPageUrl metaSinglePage;
    public PixivMetaUgoira metaUgoira;
    public PixivIllustSeries series;
    public List<String> tools;
    public String type;
    public int width;

    /* renamed from: jp.pxv.android.legacy.model.PixivIllust$Type */
    /* loaded from: classes2.dex */
    public enum Type {
        ILLUST("illust"),
        MANGA("manga"),
        UGOIRA("ugoira"),
        INVALID("");
        
        private String strType;

        Type(String str) {
            this.strType = str;
        }

        public static Type toType(String str) {
            Type[] values = values();
            Type type = null;
            for (Type type2 : values) {
                if (type2.toString().equals(str)) {
                    type = type2;
                }
            }
            return type != null ? type : INVALID;
        }

        public boolean isIllustTypeForAnalytics() {
            return this == ILLUST || this == UGOIRA;
        }

        public boolean isMangaTypeForAnalytics() {
            return this == MANGA;
        }

        @Override // java.lang.Enum, java.lang.Object
        public String toString() {
            return this.strType;
        }
    }

    public float getAspectRatioHeightOverWidth() {
        int i = this.width;
        if (i == 0) {
            return 0.0f;
        }
        return ((float) this.height) / ((float) i);
    }

    public float getAspectRatioWidthOverHeight() {
        int i = this.height;
        if (i == 0) {
            return 0.0f;
        }
        return ((float) this.width) / ((float) i);
    }

    public Type getIllustType() {
        return Type.toType(this.type);
    }
}
